package com.yjsn.base.config;

import com.yjsn.base.filter.MdcFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Liu Yang
 * @Type FilterConfig.java
 * @Desc
 * @date 2025/2/19 10:27
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<MdcFilter> myFilterRegistration() {
        FilterRegistrationBean<MdcFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new MdcFilter());
        registration.addUrlPatterns("/*");
        registration.setOrder(1);
        return registration;
    }
}
